<script setup>
import { NList, NListItem, NButton, NCard, NText, NTooltip, NSwitch } from "naive-ui";
import { ref } from "vue";
import { SetUseFakeGameDirectory } from "../../../../wailsjs/go/preference/Preference";
import { usePreferenceStore } from "../../../../stores/preference";

const pref = usePreferenceStore()

async function onFakeGameDirSwitch(value) {
    pref.fakeGameDirectory = value

    await SetUseFakeGameDirectory(value)
}
</script>

<template>
    <NCard :bordered="false" embedded>
        <template #header>
            <NText :strong="true" :depth="3">
                启动器
            </NText>
        </template>

        <NList hoverable :show-divider="false">
            <NListItem>
                <template #suffix>
                    <NSwitch :round="false" size="large" v-model:value="pref.fakeGameDirectory"
                    :on-update:value="onFakeGameDirSwitch"/>
                </template>

                <NTooltip trigger="hover" placement="top-start" :keep-alive-on-hover="false">
                    <template #trigger>
                        <NButton text size="large">版本隔离</NButton>
                    </template>
                    fuck
                </NTooltip>
            </NListItem>
        </NList>
    </NCard>
</template>